package com.example.smartcity_poverty.ui.AllService.VolunteerService

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.MenuItem
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import com.example.smartcity_poverty.R
import com.google.android.material.bottomnavigation.BottomNavigationView

/**
 * 志愿服务
 */
class VolunteerServiceActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        supportActionBar?.setDisplayHomeAsUpEnabled(true)
        setContentView(R.layout.activity_volunteer_service)
        val navView: BottomNavigationView = findViewById(R.id.vt_nav_view)

        // 获取fragment
        val navController = findNavController(R.id.vt_nav_host_fragment)
        val appBar = AppBarConfiguration(
            setOf(
                R.id.navigation_vts_homeOne,
                R.id.navigation_vts_home,
                R.id.navigation_vts_Me
            )
        )

        setupActionBarWithNavController(navController, appBar)
        navView.setupWithNavController(navController)

    }

    override fun onOptionsItemSelected(item: MenuItem): Boolean {
        finish()
        return super.onOptionsItemSelected(item)
    }
}